package io.gitee.tziye.core.search;

import io.gitee.tziye.RenaiClient;
import io.gitee.tziye.enums.SearchType;

import java.util.Collection;
import java.util.List;

public abstract class SearchOperator {

    protected final RenaiClient renaiClient;

    public SearchOperator(RenaiClient renaiClient) {
        this.renaiClient = renaiClient;
    }

    public abstract void save(RenaiText text);

    public abstract void save(Collection<RenaiText> texts);

    public abstract boolean delete(String module, String businessId);

    public abstract int delete(String module, Collection<String> businessIds);

    public abstract void drop(String module);

    public abstract List<RenaiText> search(String module, SearchType type, String word, boolean withContent, int start, int count);

    public abstract List<RenaiText> search(String module, SearchType type, List<String> words, boolean withContent, int start, int count);

    public abstract List<RenaiText> search(String module, List<SearchOps> ops, boolean withContent, int start, int count);

    public abstract List<RenaiText> search(String module, String script, boolean withContent, int start, int count);

}
